import React from 'react'
import { Switch, Route, Redirect } from 'react-router'
import { PublicRoute, AuthedRoute } from 'components/route'
import RoutePaths from 'utils/constents/routePath'
import SignInPage from './signIn'
import NotFoundPage from './notFound'
import DashBoard from './dashboard'
import Auth from './auth'

export default () => (
  <React.Fragment>
    <Switch>
      <PublicRoute path={RoutePaths.SIGN_IN} component={SignInPage} exact />
      <PublicRoute path={RoutePaths.AUTH} component={Auth} exact />
      <Route path={RoutePaths.NOT_FOUND} component={NotFoundPage} exact />
      <AuthedRoute path={RoutePaths.DASHBOARD} exact={false} component={DashBoard} />
      <Redirect exact path="*" to={RoutePaths.NOT_FOUND} />
    </Switch>
  </React.Fragment>
)
